execute as @e[type=item,distance=0..2.5] if entity @s[nbt={Item:{id:"minecraft:raw_iron"}}] run data modify entity @s Item.id set value "minecraft:iron_ingot"
execute as @e[type=item,distance=0..2.5] if entity @s[nbt={Item:{id:"minecraft:raw_gold"}}] run data modify entity @s Item.id set value "minecraft:gold_ingot"
execute as @e[type=item,distance=0..2.5] if entity @s[nbt={Item:{id:"minecraft:raw_copper"}}] run data modify entity @s Item.id set value "minecraft:copper_ingot"